<?
/*
 *   Pmail easy way to send emails
 *   Copyright (C) 2009  Felipe Theodoro Gonçalves (www.ftgoncalves.com)
 *
 *   This program is free software: you can redistribute it and/or modify
 *	 it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
?>
<div id="page">
<p class="ind"><?= $html->link(__d('pmail', 'Send mail', true), array('plugin' => 'pmail', 'controller' => 'mails', 'action' => 'index')); ?> > <?= __d('pmail', 'See email configured') ?></p>
	<h2><?= __d('pmail', 'See email configured') ?></h2>
	<table>
		<caption class="left"><?= __d('pmail', 'List of emails configured') ?></caption>
		<thead>
			<tr>
				<th scope="col"><?= __d('pmail', 'Identifier') ?></th>
				<th scope="col"><?= __d('pmail', 'Created') ?></th>
				<th scope="col"><?= __d('pmail', 'Option') ?></th>
			</tr>
		</thead>
		<tbody>
		<?php
			$count = 0;
			foreach($emails as $aux){
				foreach($aux as $email){
					$email['created'] = str_replace('-','/', $email['created']);
					echo '<tr id="' . $count++ . '">';
						echo '<td>' . $email['identifier'] . '</td>';
						echo '<td>' . substr($email['created'],0,10) . '</td>';
						echo '<td>';
							echo $html->link($html->image('/pmail/img/iconeEditar.gif', array('alt' => 'Editar', 'border' => 0)), array('plugin' => 'pmail', 'controller' => 'mails', 'action' => 'edit_email', 'id' => $email['id']), array(), false, false);
							echo $html->link($html->image('/pmail/img/iconeExcluir.gif', array('alt' => 'Excluir', 'border' => 0)), array('plugin' => 'pmail', 'controller' => 'mails', 'action' => 'delete_email', 'id' => $email['id']), array(), __d('pmail', 'Are you sure you want to delete this user', true), false);
						echo '</td>';
					echo '</tr>';
				}
			}
		?>
		</tbody>
	</table>
</div>
<div id="sidebar">
	<h4><?= __d('pmail', 'Coments') ?></h4>
	<p><?= __d('pmail', 'View the e-mails set up') ?>.</p>
	<?= $this->requestAction('/pmail/mails/menu'); ?>
	<?= $this->renderElement('recommended/links'); ?>
</div>
<div class="clear"></div>
<script type="text/javascript">
	$().ready(function(){
		$('table tbody tr:odd').addClass('impar');
	});

</script>